package club.pchome.common.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

import java.util.concurrent.Executors;

/**
 * Description: 多线程执行定时任务
 * Designer: jack
 * Date: 2017/8/10
 * Version: 1.0.0
 * form : https://my.oschina.net/jack90john/blog/1506474
 */

@Configuration
public class ScheduleConfig implements SchedulingConfigurer {

    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {

        taskRegistrar.setScheduler(Executors.newScheduledThreadPool(5));
    }
}
